﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>找裁判</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <link href="https://cdn.bootcss.com/amazeui/2.7.2/css/amazeui.css" rel="stylesheet">
    <link href="css/common.css" rel="stylesheet" />
    <style>
        .main {
            width: 100%;
        }
    </style>
</head>
<body>
    <div class="page" id="page" v-cloak>
        <header data-am-widget="header" class="am-header am-header-default" style="background-color: #FFFFFF; border-bottom: 1px solid rgb(211, 211, 211);">
            <div class="am-header-left am-header-nav" onclick="goBack()">
                <a href="javascript:" class="">
                    <img class="am-header-icon-custom" src="images/veas07.png" alt="" />
                </a>
            </div>
            <h4 class="am-header-title" style=" color: black;">找裁判</h4>
            <div class="am-header-right am-header-nav"><a href="/Wap/Index.html" class="am-header-icon am-icon-home" style="color: #A9A9A9; "></a></div>
        </header>
        <div class="main">
            <div class="am-u-sm-12" style="background: #fff;padding: 2% 0;    border-bottom: 1px solid #dedede;">
                <!--<div class="am-u-sm-2" style="padding: 0;margin-top: 0.8%;">
                    <select data-am-selected>
                        <option value="a" selected>无锡</option>
                        <option value="b">Banana</option>
                        <option value="o">Orange</option>
                        <option value="m">Mango</option>
                    </select>
                </div>-->
                <div class="am-u-sm-10 am-form-group am-form-icon am-form-feedback" style="width: 100%;display: block;margin: 0 auto;">
                    <input type="text" v-model="keyword" class="am-form-field search" placeholder="输入裁判姓名" style="padding: 2%;border-radius: 50px;padding-left: 7% !important;background: #f2f2f2">
                    <span class="am-icon-search" style="right: 2.5rem;"></span>
                </div>
            </div>
            <div class="am-list-news-bd">
                <ul class="am-list" style="margin-bottom: 0">

                    <li style="border-top:none;overflow: hidden;margin-bottom: 0;padding-top: 1rem;" class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left" v-for="list in CoachList" v-on:click="coachInfo(list.Id)">
                        <div style="padding-right: 0" class="am-u-sm-3 am-list-thumb">
                            <a href="javascript:">
                                <img v-bind:src="list.faceImg" style="width: 100%;border-radius: 50%;">
                            </a>
                        </div>
                        <div class=" am-u-sm-9 am-list-main">
                            <div class="am-list-item-hd am-g" style=" font-size: 1.7rem;margin: 4% 0;overflow: hidden">
                                <span class="" style="display: block;float: left;font-size: 1.8rem;padding: 0">{{list.Name}}</span>
                                <img class="am-u-sm-4" src="images/coach03.png" alt="" style="width: 25%;display: block;float: left; margin-top: 3.5%;padding: 0; margin-left: 3%;">
                                <div class="am-u-sm-4" style="float: right;padding: 0">
                                    <img src="images/coach01.png" alt="" style="width:20%">
                                    <span style="color: #a7a7a7;font-size: 1.3rem">金牌裁判</span>
                                </div>
                            </div>
                            <div class="am-list-item-text">
                                <div class="am-u-sm-7" style="padding: 0;font-size: 1.3rem">
                                    累计授课<span style="font-size: 1.7rem;"> 420</span>课时
                                </div>
                                <div class="am-u-sm-5" style="text-align: right;padding: 0;margin-top: 2%;">
                                    <span class="am-badge am-radius" style="color: #fff;background: #00afff;">
                                        <img v-bind:src="list.Sex==1?'images/coach04.png':'images/coach05.png'" alt="" style="    width: 30%;margin-top: -7%;">{{list.age}}
                                    </span>
                                    <span class="am-badge am-radius" style="color: #fff;background: #f6a279">裁判</span>
                                </div>
                            </div>
                        </div>
                    </li>

                </ul>
            </div>
        </div>
        <div v-if="pageinfo.pageCount>page" class="am-list-news-ft" style="padding-bottom:15px;">
            <a class="am-list-news-more am-btn am-btn-default" v-on:click="page=page+1" href="javascript:void(0)">查看更多 &raquo;</a>
        </div>
        <div v-if="pageinfo.pageCount==page" class="am-list-news-ft" style="padding-bottom:15px;color:#757575;">
            无更多数据
        </div>
    </div>
</body>
<script src="https://use.fontawesome.com/ca6b609d64.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.js"></script>
<script src="js/common.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
<script src="https://cdn.bootcss.com/amazeui/2.7.2/js/amazeui.js"></script>
</html>
<script>
    var page = new Vue({
        el: '#page',
        data: {
            CoachList: [],
            page: 1,
            pagesize: 10,
            pageinfo: {},
            keyword: ''
        },
        methods: {
            getCoachList: function () {
                var that = this;
                $.ajax({
                    type: 'GET',
                    data: { page: that.page, pagesize: that.pagesize, keyword: that.keyword },
                    url: window.apiUrl + '/Api/Data/RefereeList',
                    success: function (data) {
                        console.log(data);
                        if (data.errcode == 0) {
                            if (that.page == 1) {
                                that.CoachList = data.data.CoachList;
                            } else {
                                $(data.data.CoachList).each(function () {
                                    that.CoachList.push(this);
                                })
                            }
                            that.pageinfo = data.data.Page;
                        } else {
                            alert(data.errmsg);
                        }
                    },
                    //error: function () {
                    //    alert("服务器加载异常");
                    //}
                })
            },
            coachInfo: function (id) {
                location.href = 'Referee_detail.html?gId=' + id;
            }
        },
        watch: {
            keyword: function () {
                this.page = 1;
                this.getCoachList();
            },
            page: function () {
                this.getCoachList();
            }
        }
    })
    $(function () {
        page.getCoachList();
    })
</script>
